<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="format-detection" content="telephone=no" />
<title>我的<?php echo $output['site_name']?></title>
<link href="<?php echo TEMPLATE_SITE_URL;?>/css/common.css" type="text/css" rel="stylesheet">
<link href="<?php echo TEMPLATE_SITE_URL;?>/css/user.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/zepto.js" charset="utf-8"></script>
</head>
<body>

<div id="pop4" class="concernDiv" style="display: none;">
  <div class="concern">
  	<p class="conTitle1" style="text-align:center;"><span>您的拍品确认<font class="showword" is_show="1">隐藏</font>？</span></p>
  	<input type="hidden" name="show_id">
  	<a class="whiteBn sh1auction">确认</a>
  	<a class="greyBn">取消</a>
  </div>
</div>

<div id="pop3" class="concernDiv" style="display: none;">
  <div class="concern">
  	<p class="conTitle1" style="text-align:center;"><span>您的拍品确认下架？</span></p>
  	<input type="hidden" name="xiajia_id">
  	<a class="whiteBn xiajiapaipin">确认</a>
  	<a class="greyBn">取消</a>
  </div>
</div>

<div id="pop2" class="concernDiv" style="display: none;">
  <div class="concern">
  	<p class="conTitle1" style="text-align:center;"><span>您的拍品确认删除？</span></p>
  	<input type="hidden" name="delete_id">
  	<a class="whiteBn delauction">确认</a>
  	<a class="greyBn">取消</a>
  </div>
</div>

<div id="contentbox">
  <div class="myMain">
    <div class="myinfoContainer"> <a href="index.php?act=my&op=home&uid=<?php echo $output['user']['user_id'];?>">
      <div class="avatarBox">
        <div class="avatar" style="background-image: url(<?php echo $output['user']['avatar'];?>)">
        	<a class="renew" href="javascript:;">更新</a>
        </div>
      </div>
      
      <script type="text/javascript">
		$(function(){
			$('.renew').click(function(){
				$.ajax({
					type:'get',
					url:'index.php?act=my&op=renew',
					dataType:'json',
					success:function(data){
						if(data.state=='1'){
							location.reload();
						}	
					}
				});
			});
		});
      </script>
      
      <div class="name"><?php echo $output['user']['nickname']?></div>
      <div class="signature"><?php echo $output['user']['signature']?></div>
      </a>
      <div class="statics"> 
      	<a href="index.php?act=my&op=focus&user_id=<?php echo $output['user']['user_id'];?>">
        	<div class="staticsItem"><?php echo $output['mcount'];?><br>关注</div>
        </a>
        <div class="line"></div>
        <a href="index.php?act=my&op=fans&user_id=<?php echo $output['user']['user_id'];?>">
        	<div class="staticsItem"><?php echo $output['fcount'];?><br>粉丝</div>
        </a>
        <div class="line"></div>
        <a href="index.php?act=my&op=userorder&user_id=<?php echo $output['user']['user_id'];?>">
        <div class="staticsItem"><?php echo $output['usernum'];?><br>买入</div>
        </a>
        <div class="line"></div>
        <a href="index.php?act=my&op=sellerorder&user_id=<?php echo $output['user']['user_id'];?>">
        <div class="staticsItem"><?php echo $output['sellernum'];?><br>卖出</div>
        </a> </div>
    </div>
    <div class="menuBanner">
      <div class="menuItem selected" onclick="javascript:location.href='index.php?act=my'"><span>我发布的</span> </div>
      <div class="menuItem " onclick="javascript:location.href='index.php?act=my&type=1'"><span>我喜欢的</span> </div>
      <div class="shakeMenuItem" onclick="javascript:location.href='index.php?act=index&op=yao';"></div>
    </div>
    <div class="listContainer">
      <!-- 进行中 -->
      <?php if(!empty($output['jingxing_auction_array'])){?>
      <div class="saleBox over">
	      <?php foreach($output['jingxing_auction_array'] as $jingxing_auction_array){?>  
	      <a href="index.php?act=index&auction_id=<?php echo $jingxing_auction_array['id'];?>">
		      <div class="saleItem">
			    <div class="saleImg" style="background-image: url(<?php echo UPLOAD_SITE_URL.'/shop/auction/'.$jingxing_auction_array['auction_add_date'].'/'.$jingxing_auction_array['auction_img1'];?>);">
					<?php if(empty($jingxing_auction_array['auction_log_id'])){?>
					<div class="handle hide" auction_id="<?php echo $jingxing_auction_array['id'];?>"></div>
					<?php }?>
	      		</div>	
	      		<div class="saleDesc"><?php echo $jingxing_auction_array['auction_description'];?></div>  
		      </div>
	      </a>   
	      <?php }?>
      </div>
      <?php }?>
      
      <!-- 待发布拍品 -->
      <?php if(!empty($output['daifa_auction_array'])){?>
      <div class="titleBanner">
        <div class="title">待发布拍品</div>
      </div>
      <div class="saleBox over">
      <?php foreach($output['daifa_auction_array'] as $daifa_auction_array){?>  
        <?php if($daifa_auction_array['cashprice']>0){?>
      	<a href="index.php?act=index&op=auctionselleraddcash&auction_id=<?php echo $daifa_auction_array['id'];?>">     	
      	<?php }else{?>
      	<a href="index.php?act=publish&op=step1&auction_id=<?php echo $daifa_auction_array['id'];?>">
      	<?php }?>
      	<div class="saleItem">
      		<div class="saleImg" style="background-image: url(<?php echo UPLOAD_SITE_URL.'/shop/auction/'.$daifa_auction_array['auction_add_date'].'/'.$daifa_auction_array['auction_img1'];?>);">
				<div class="handle delete" auction_id="<?php echo $daifa_auction_array['id'];?>"></div>
      		</div>	      		      			
      		<div class="saleDesc"><?php echo $daifa_auction_array['auction_description'];?></div>
      		<?php if($daifa_auction_array['cashprice']>0){?>
          	<div class="saleInfo">
            	<div class="bid"><span>未支付保证金</span></div>
          	</div> 
          	<?php }else{?>
          	<div class="saleInfo">
            	<div class="bid"><span>草稿</span></div>
          	</div> 
          	<?php }?> 
      	</div>
      	</a>
      <?php }?>
      </div>
	  <?php }?>
	  
	  <!-- 截拍拍品 -->
	  <?php if(!empty($output['jiepai_auction_array'])){?>	  
      <div class="titleBanner">
        <div class="title">截拍拍品</div>
      </div>
      <div class="saleBox over jiepai">
      	<?php foreach($output['jiepai_auction_array'] as $jiepai_auction_array){?>  
	      	<a href="index.php?act=index&auction_id=<?php echo $jiepai_auction_array['id'];?>">
	      	<div class="saleItem">
	      		<div class="saleImg" style="background-image: url(<?php echo UPLOAD_SITE_URL.'/shop/auction/'.$jiepai_auction_array['auction_add_date'].'/'.$jiepai_auction_array['auction_img1'];?>);">
					<?php if($jiepai_auction_array['auction_log_id']>0){?>
						<?php if($jiepai_auction_array['is_show']==1){?>
						<div class="option_view shauction" is_show="0" auction_id="<?php echo $jiepai_auction_array['id'];?>"></div>
						<?php }else{?>
						<div class="option_hide shauction" is_show="1" auction_id="<?php echo $jiepai_auction_array['id'];?>"></div>
						<?php }?>
					<?php }else{?>
						<div class="handle hide" auction_id="<?php echo $jiepai_auction_array['id'];?>"></div>
					<?php }?>      		
	      		</div>
	      		<div class="saleDesc"><?php echo $jiepai_auction_array['auction_description'];?></div>
	      		<?php if($jiepai_auction_array['auction_log_id']>0){?>
	      		<div class="saleInfo">
	            	<div class="bid"><span>￥<?php echo $jiepai_auction_array['firstprice'];?>元</span></div>
	            	<div class="statics"><?php echo $jiepai_auction_array['viewnum'];?></div>
	          	</div>  
	          	<?php }else{?>
		      	<div class="saleInfo">
	            	<div class="bid"><span>流拍</span></div>
	          	</div>  
	          	<?php }?>
	      	</div> 	
	      	</a>
      	<?php }?>
      </div>      
      <?php }?>
      
      <?php if(empty($output['daifa_auction_array'])&&empty($output['jiepai_auction_array'])&&empty($output['jingxing_auction_array'])){?>      
      <div class="saleBox over">
        <div class="noSale">
			<p class="camera"><img src="<?php echo TEMPLATE_SITE_URL;?>/images/shopEmpty.png" width="196" height="120"></p>        
		</div>
      </div>
	  <?php }?>

    </div>
    <div class="listContainer like">
      <div class="saleBox like"></div>
    </div>
  </div>
  <div class="myMenu showtip"></div>
  <div class="myMenuMain">
    <div class="menuMask"></div>
    <div class="menuBox">
      <div class="menuItem userinfo">
        <div class="avatar" style="background-image: url(<?php if(!empty($output['user']['avatar'])){ echo $output['user']['avatar'];}else{ echo 'member.png';}?>)"></div>
        <div class="name"><?php echo $output['user']['nickname']?>
          <div class="syncUserinfo"></div>
        </div>
        <div class="signature"></div>
      </div>
      <a href="index.php?act=my&op=message">
      <div class="menuItem msg">
        <div class="title">我的消息</div>
        <div class="desc"><span>不错过</span>每个消息</div>
      </div>
      </a>
      <a href="index.php?act=my&op=myinfo&user_id=<?php echo $output['user']['user_id'];?>">
      <div class="menuItem balance">
        <div class="title">我的余额</div>
        <div class="desc">余额<span> <?php echo $output['user']['price'];?>元</span></div>
      </div>
      </a>
      <a href="index.php?act=my&op=userorder&userid=<?php echo $output['user']['user_id'];?>">
      <div class="menuItem order">
        <div class="title">我的订单</div>
        <div class="desc">买买买，<span>卖卖卖</span></div>
      </div>
      </a>
      <a href="index.php?act=index&op=qunfa">
      <div class="menuItem saleMsg">
        <div class="title">群发消息</div>
        <div class="desc"><span>群发</span>拍品消息</div>
      </div>
      </a>
      <a href="index.php?act=index&op=yao&cate_id=1&t=<?php echo time();?>">
      <div class="menuItem shake">
        <div class="title">摇一摇</div>
        <div class="desc"><span>搜罗</span>兴趣拍品</div>
      </div>
      </a>
      <a href="index.php?act=renzheng&op=renzheng">
      <div class="menuItem manage">
        <div class="title">资质认证</div>
      </div>
      </a>	  <a href="index.php?act=renzheng&op=zhuanchang&curpage=1">      <div class="menuItem manage">        <div class="title">我的专场</div>      </div>      </a>

      <div class="menuBottom">
        <div class="menuItem help" onclick="location.href='<?php echo $output['help_link']['value'];?>';">
          <div class="title">帮助中心</div>
        </div>
        <div class="menuItem about" onclick="location.href='<?php echo $output['about_link']['value'];?>';">
          <div class="title">关于<?php echo $output['site_name'];?></div>
        </div>
    </div>
    </div>

  </div>  
 <a href="index.php?act=my&op=myinfo">
 	<div class="balanceMenu"><?php echo $output['user']['price'];?> 元</div>
 </a>
</div>
<input type="hidden" name="haspage" value="<?php echo $output['haspage'];?>" id="haspage">
<input type="hidden" name="pagenum" value="0" id="pagenum">
<div class="loadNextPage" style="margin-top:10px;color:#777;text-align:center;font-size:13px;display:none;">
	<div class="loading" style="width:100px;height:40px;margin-left:auto;margin-right:auto">
		<img src="<?php echo TEMPLATE_SITE_URL;?>/images/loadingData.gif" style="float:left">
		<span style="float:left;margin-top:10px;">加载拍卖</span>
	</div>
</div>
<script>
$(function(){

	    $(window).scroll(function () {
	        var $body = $("body");
	        if (($(window).height() + $(window).scrollTop()) >= $body.height()) {
		        var haspage = parseInt($('#haspage').val());
		        if(haspage=='0'){
					return false;
				}
	    		var pagenum = parseInt($('#pagenum').val());
	    		var nextpage = eval(pagenum+1);
	    				
				$.ajax({
					type:'get',
					url:'index.php?act=my&op=getjiepaidate',
					data:{nextpage:nextpage},
					dataType:'html',
					success:function(html){
						$('.loadNextPage').hide();
						if(html==''){
							$('#haspage').val('0');
						}else{
							$('#pagenum').val(nextpage);
							$('.jiepai').append(html);
						}


						$('.shauction').click(function(){
							var auction_id = $(this).attr('auction_id');
							var is_show = $(this).attr('is_show');
							$('input[name=show_id]').val(auction_id);	

							if(is_show=='1'){
								$('.showword').html('隐藏');	
								$('.showword').attr('is_show','1');	
							}else{
								$('.showword').html('显示');
								$('.showword').attr('is_show','0');		
							}
							$('#pop4').show();
							return false;	
						});

						$('.sh1auction').click(function(){
							var auction_id = $('input[name=show_id]').val();
							var is_show = $('.showword').attr('is_show');

							$.ajax({
								type:'get',
								url:'index.php?act=my&op=updateshow',
								data:{auction_id:auction_id,is_show:is_show},
								dataType:'json',
								success:function(data){
									if(data.state == 1){
										location.reload();
									}				
								}
							});
							return false;	
						});
						
						$('.xiajiapaipin').click(function(){
							var auction_id = $('input[name=xiajia_id]').val();
							var state = '1';
							$.ajax({
								type:'get',
								url:'index.php?act=my&op=updatestate',
								data:{auction_id:auction_id,is_state:state},
								dataType:'json',
								success:function(data){
									if(data.state == 1){
										location.reload();
									}				
								}
							});
							return false;		
						});							
					},
					beforeSend:function(){
						$('.loadNextPage').show();
					}
				});
	        }
	    });

		$('.shauction').click(function(){
			var auction_id = $(this).attr('auction_id');
			var is_show = $(this).attr('is_show');
			$('input[name=show_id]').val(auction_id);	

			if(is_show=='1'){
				$('.showword').html('隐藏');	
				$('.showword').attr('is_show','1');	
			}else{
				$('.showword').html('显示');
				$('.showword').attr('is_show','0');		
			}
			$('#pop4').show();
			return false;	
		});
	
	
		$('.handle.delete').click(function(){
			$('#pop2').show();
			var auction_id = $(this).attr('auction_id');
			$('input[name=delete_id]').val(auction_id)
			return false;

		});

		
		$('.delauction').click(function(){
			var auction_id = $('input[name=delete_id]').val();

			$.ajax({
				type:'get',
				url:'index.php?act=my&op=delauction',
				data:{auction_id:auction_id},
				dataType:'json',
				success:function(){
					location.reload();
				}
			});
			return false;
		});

		
		function update(auction_id,state){
			$.ajax({
				type:'get',
				url:'index.php?act=my&op=updatestate',
				data:{auction_id:auction_id,is_state:state},
				dataType:'json',
				success:function(){
					return false;
				}
			});
		}
			
	$('.showtip').click(function(){
		$('.myMenuMain').show();
	});

	$('.menuBox').click(function(){
		$('.myMenuMain').hide();
	});

	$('.renew').click(function(){
		
	});

	$('.hide').click(function(){
		$('#pop3').show();
		var auction_id = $(this).attr('auction_id');
		$('input[name=xiajia_id]').val(auction_id)
		return false;
	});

	$('.sh1auction').click(function(){
		var auction_id = $('input[name=show_id]').val();
		var is_show = $('.showword').attr('is_show');

		$.ajax({
			type:'get',
			url:'index.php?act=my&op=updateshow',
			data:{auction_id:auction_id,is_show:is_show},
			dataType:'json',
			success:function(data){
				if(data.state == 1){
					location.reload();
				}				
			}
		});
		return false;	
	});

	
	$('.xiajiapaipin').click(function(){
		var auction_id = $('input[name=xiajia_id]').val();
		var state = '1';
		$.ajax({
			type:'get',
			url:'index.php?act=my&op=updatestate',
			data:{auction_id:auction_id,is_state:state},
			dataType:'json',
			success:function(data){
				if(data.state == 1){
					location.reload();
				}				
			}
		});
		return false;		
	});
	
	$('.greyBn').click(function(){
		$('#pop2').hide();
		$('#pop3').hide();
		$('#pop4').hide();
	});
	
});
</script>
<?php include template('home/nav');?>
</body>
</html>
